<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>箭头函数</title>
</head>
<body>
<script>
    //定义单参数带返回值的函数
    var fun1 = function (msg) {
        return msg+" World！";
    }
    var message = fun1("Hello");
    console.log(message);

    //使用箭头函数的方式
    var fun2 = x =>x+" World";
    console.log(fun2("Hi"));

    //多个参数的箭头函数，不能省略()
    var add = (a,b)=>a+b;
    console.log(add(3,1));

    console.log(`3+4=${add(3,4)}`)
</script>
</body>
</html>